﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ViewMessage.aspx.cs"
    Inherits="ContractManagementSystem.ViewMessage" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PanelContent" runat="server">
    <div class="MessLeft">
        <div class="messTitle">
            Message</div>
        <div id="inbox">
            <asp:LinkButton ID="InboxLinkButton" runat="server" ForeColor="white" OnClick="InboxLinkButton_OnClick">Inbox
            </asp:LinkButton>
        </div>
        <div id="sentItem">
            <asp:LinkButton ID="SendItemsLinkButton" runat="server" ForeColor="white" OnClick="SendItemsLinkButton_OnClick">Outbox</asp:LinkButton>
        </div>
    </div>
    <div class="MessRight">
        <div class="boxTitle">
            <div id="newMess">
                <asp:LinkButton ID="NewMessageLinkButton" runat="server" ForeColor="white" OnClick="NewMessageLinkButton_OnClick">New Message            
                </asp:LinkButton>
            </div>
            <div id="delMess">
                <asp:UpdatePanel runat="server">
                    <ContentTemplate>
                        <asp:LinkButton ID="DeleteLinkButton" runat="server" ForeColor="white" OnClick="DeleteLinkButton_OnClick">Delete           
                        </asp:LinkButton>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </div>
        <asp:UpdatePanel runat="server">
            <ContentTemplate>
                <asp:Panel ID="NewMessagePanel" runat="server">
                    <table style="height: 100%; width: 98%; margin: 0 auto;">
                        <tr>
                            <td style="width: 78px; color: white">
                                Send To...
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <asp:TextBox runat="server" Width="95%" ID="UserTextBox"></asp:TextBox>
                                        <asp:Image runat="server" ID="CheckImage" Height="20px" Width="20px" />
                                        <asp:LinkButton ID="CheckNameLinkButton" runat="server" ForeColor="white" Font-Bold="True"
                                            OnClick="CheckNameLinkButtonClick">Check Name</asp:LinkButton>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:TextBox runat="server" Width="100%" TextMode="MultiLine" Height="300px" ID="ContentTextBox"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center">
                                <asp:Label runat="server" ID="MessLabel"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center">
                                <asp:Button runat="server" Text="Send" ID="SendButton" OnClick="SendButtonClick" />
                                <asp:Button runat="server" Text="Clear" ID="ClearButton" OnClick="ClearButtonClick" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel runat="server" ID="ViewMessagePanel">
                    <asp:ListView ID="MessageListView" runat="server" ItemPlaceholderID="NewItem" OnItemEditing="NewListViewItemEditing"
                        OnItemDeleting="NewListViewItemDeleting">
                        <LayoutTemplate>
                            <table id="table">
                                <tr>
                                    <th style="width: 20px;">
                                        <input type="checkbox" id="HeaderCheckbox" />
                                    </th>
                                    <th style="width: 20px; text-align: center">
                                        <asp:Image runat="server" ID="Image1" ImageUrl="Images/msg-rd0.gif" />
                                    </th>
                                    <th style="width: 70px;">
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="From"
                                            ID="FromLinkButton">From</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortRole" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th>
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="Content"
                                            ID="ContentLinkButton">Content</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortUserName" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                    <th style="width: 140px; text-align: center">
                                        <asp:LinkButton runat="server" ToolTip="Sort" CommandName="Sort" CommandArgument="Received"
                                            ID="ReceivedLinkButton">Received</asp:LinkButton>
                                        <asp:Image runat="server" ID="SortCreateDate" ImageUrl="App_Themes/Admin/Image/down.png" />
                                    </th>
                                </tr>
                                <tr>
                                    <asp:PlaceHolder runat="server" ID="NewItem"></asp:PlaceHolder>
                                </tr>
                            </table>
                        </LayoutTemplate>
                        <EmptyDataTemplate>
                            <h4 style="color: white; text-align: center; padding: 10px 0px 10px 0px">
                                There are no items to show in this view.</h4>
                        </EmptyDataTemplate>
                        <ItemTemplate>
                            <tr class="odd">
                                <td>
                                    <input type="checkbox" runat="server" id="ItemCheckbox" value='<%#Eval("MessageId") %>' />
                                </td>
                                <td style="text-align: center">
                                    <img src='Images/msg-rd<%#Eval("Status")%>.gif' />
                                </td>
                                <td style="text-align: left; padding-left: 15px">
                                    <asp:Label runat="server" ID="UserNameLabel" Text='<%#Eval("FromUserName")%>'></asp:Label>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:LinkButton runat="server" ID="editLinkButton" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"MessageId")%>'
                                        OnCommand="EditOnCommand">
                                            <%#Eval("Content")%>
                                    </asp:LinkButton>
                                </td>
                                <td>
                                    <asp:Label runat="server" ID="SendDateLabel" Text='<%#Eval("SendDate")%>'></asp:Label>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="alt">
                                <td>
                                    <input type="checkbox" id="ItemCheckbox" runat="server" value='<%#Eval("MessageId") %>' />
                                </td>
                                <td style="text-align: center">
                                    <img src='Images/msg-rd<%#Eval("Status")%>.gif' />
                                </td>
                                <td style="text-align: left; padding-left: 15px">
                                    <asp:Label runat="server" ID="UserNameLabel" Text='<%#Eval("FromUserName")%>'></asp:Label>
                                </td>
                                <td style="text-align: left; padding-left: 10px;">
                                    <asp:LinkButton runat="server" ID="editLinkButton" CommandName="Edit" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"MessageId")%>'
                                        OnCommand="EditOnCommand">
                                            <%#Eval("Content")%>
                                    </asp:LinkButton>
                                </td>
                                <td>
                                    <asp:Label runat="server" ID="SendDateLabel" Text='<%#Eval("SendDate")%>'></asp:Label>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:ListView>
                    <asp:Panel runat="server" ID="PagePanel">
                        <div class="divPage">
                            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="MessageListView" PageSize="10"
                                OnPreRender="DataPagerListPage">
                                <Fields>
                                    <asp:NextPreviousPagerField />
                                    <asp:NumericPagerField ButtonCount="5" CurrentPageLabelCssClass="curent" />
                                    <asp:NextPreviousPagerField />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </asp:Panel>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
